function defaultValue(defaults: {[key: string]: any}) {
  return function<T extends { new (...args:any[]): {}}>(constructor: T) {
    return class extends constructor {
      constructor(...args) {
        super(...args)
        Object.keys(defaults).forEach(key => {
          if (this[key] === undefined) {
            this[key] = defaults[key]
          }
        })
      }
    }
  }
}

@defaultValue({
  theme: 'dark'
})
class Settings {
  theme: string
}
let s = new Settings()
console.log(s.theme)
export {}
